<?php

Raise::load('core.helper.routing.RaiseUrlRoute');

/**
 * TestCoreRaiseUrlRoute class
 * Testing unit of 'phpraise/core/RaiseUrlRoute.php'
 *
 * @author Sam-Mauris Yong / hellclanner at live dot com
 * @license http://www.opensource.org/licenses/bsd-license New BSD License
 * @package Raise.UnitTest.Test
 */
class TestCoreRaiseUrlRoute extends RaiseTest {
    
    public static function testClass(){
        self::assertClassExists('RaiseUrlRoute');
        self::assertClassExtends('RaiseUrlRoute', 'RaiseObject');
        self::assertClassMethod('RaiseUrlRoute', array('httpMethod', 'actual', 'rewrite'));
    }

    public static function testObject(){
        $r = new RaiseUrlRoute('article/{id}-{title}', 'Article', 'GET', array('$id$' => '[0-9]'));
        self::assertObjectClass($r, 'RaiseUrlRoute');
        self::assertStrictEqual($r->rewrite(), 'article/{id}-{title}');
        self::assertStrictEqual($r->actual(), 'Article');
        self::assertStrictEqual($r->httpMethod(), 'GET');
    }


}
